<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <!-- 1. 安装 vue-router 路由模块 -->
    <script src="https://cdn.bootcss.com/vue-router/3.1.3/vue-router.js"></script>

    <style>
        html,
        body {
            margin: 0;
            padding: 0px;
        }

        .header {
            background-color: orange;
            height: 80px;
        }

        h1 {
            margin: 0;
            padding: 0;
            font-size: 16;
        }

        .container {
            display: flex;
        }

        .left {
            background-color: orchid;
            flex: 2;
            height: 400px;
        }

        .main {
            background-color: palevioletred;
            flex: 8;
            height: 400px;
        }
    </style>
</head>

<body>
    <div id="app">
        <router-view></router-view>
        <div class="container">
            <router-view name="left"></router-view>
            <router-view name="main"></router-view>
        </div>

    </div>

    <script>
        var header = {
            template: '<h1 class="header">Header头部区域</h1>'
        }

        var leftBox = {
            template: '<h1 class="left">leftBox左部区域</h1>'
        }
        var mainBox = {
            template: '<h1 class="main">mainBox中部区域</h1>'
        }

        var router = new VueRouter({
            routes: [{
                path: '/',
                components: {
                    'default': header,
                    'left': leftBox,
                    'main': mainBox
                }
            }, ]
        })

        var vm = new Vue({
            el: '#app',
            data: {},
            methods: {},
            router: router
        })
    </script>
</body>

</html>